home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / MPW / Interfaces / CIncludes / Dialogs.h < prev    next >
Text File  |  1990-12-13  |  5KB  |  178 lines

  1. /************************************************************
  2.  
  3. Created: Thursday, September 7, 1989 at 3:41 PM
  4.     Dialogs.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.     1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __DIALOGS__
  15. #define __DIALOGS__
  16.  
  17. #ifndef __WINDOWS__
  18. #include <Windows.h>
  19. #endif
  20.  
  21. #ifndef __TEXTEDIT__
  22. #include <TextEdit.h>
  23. #endif
  24.  
  25. #define ctrlItem 4
  26. #define btnCtrl 0
  27. #define chkCtrl 1
  28. #define radCtrl 2
  29. #define resCtrl 3
  30. #define statText 8
  31. #define editText 16
  32. #define iconItem 32
  33. #define picItem 64
  34. #define userItem 0
  35. #define itemDisable 128
  36. #define ok 1
  37. #define cancel 2
  38. #define stopIcon 0
  39. #define noteIcon 1
  40. #define cautionIcon 2
  41.  
  42. typedef short StageList;
  43.  
  44. typedef WindowPtr DialogPtr;
  45.  
  46. typedef pascal void (*ResumeProcPtr)(void);
  47. typedef pascal void (*SoundProcPtr)(void);
  48. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  49.  
  50.  
  51. struct DialogRecord {
  52.     WindowRecord window;
  53.     Handle items;
  54.     TEHandle textH;
  55.     short editField;
  56.     short editOpen;
  57.     short aDefItem;
  58. };
  59.  
  60. typedef struct DialogRecord DialogRecord;
  61. typedef DialogRecord *DialogPeek;
  62.  
  63. struct DialogTemplate {
  64.     Rect boundsRect;
  65.     short procID;
  66.     Boolean visible;
  67.     Boolean filler1;
  68.     Boolean goAwayFlag;
  69.     Boolean filler2;
  70.     long refCon;
  71.     short itemsID;
  72.     Str255 title;
  73. };
  74.  
  75. typedef struct DialogTemplate DialogTemplate;
  76. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  77.  
  78. struct AlertTemplate {
  79.     Rect boundsRect;
  80.     short itemsID;
  81.     StageList stages;
  82. };
  83.  
  84. typedef struct AlertTemplate AlertTemplate;
  85. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  86.  
  87. #ifdef __cplusplus
  88. extern "C" {
  89. #endif
  90. pascal void InitDialogs(ResumeProcPtr resumeProc)
  91.     = 0xA97B;
  92. pascal void ErrorSound(SoundProcPtr soundProc)
  93.     = 0xA98C;
  94. pascal DialogPtr NewDialog(Ptr wStorage,const Rect *boundsRect,const Str255 title,
  95.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  96.     Handle itmLstHndl)
  97.     = 0xA97D;
  98. DialogPtr newdialog(Ptr wStorage,const Rect *boundsRect,char *title,Boolean visible,
  99.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl);
  100. pascal DialogPtr GetNewDialog(short dialogID,Ptr dStorage,WindowPtr behind)
  101.     = 0xA97C;
  102. pascal void CloseDialog(DialogPtr theDialog)
  103.     = 0xA982;
  104. pascal void DisposDialog(DialogPtr theDialog)
  105.     = 0xA983;
  106. pascal void CouldDialog(short dialogID)
  107.     = 0xA979;
  108. pascal void FreeDialog(short dialogID)
  109.     = 0xA97A;
  110. pascal void ParamText(const Str255 param0,const Str255 param1,const Str255 param2,
  111.     const Str255 param3)
  112.     = 0xA98B;
  113. pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  114.     = 0xA991;
  115. pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  116.     = 0xA97F;
  117. pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  118.     short *itemHit)
  119.     = 0xA980;
  120. pascal void DrawDialog(DialogPtr theDialog)
  121.     = 0xA981;
  122. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  123.     = 0xA978;
  124. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  125.     = 0xA985;
  126. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  127.     = 0xA986;
  128. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  129.     = 0xA987;
  130. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  131.     = 0xA988;
  132. pascal void CouldAlert(short alertID)
  133.     = 0xA989;
  134. pascal void FreeAlert(short alertID)
  135.     = 0xA98A;
  136. pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  137.     Rect *box)
  138.     = 0xA98D;
  139. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  140.     const Rect *box)
  141.     = 0xA98E;
  142. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  143.     = 0xA827;
  144. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  145.     = 0xA828;
  146. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  147.     = 0xA97E;
  148. pascal void GetIText(Handle item,Str255 text)
  149.     = 0xA990;
  150. pascal void SetIText(Handle item,const Str255 text)
  151.     = 0xA98F;
  152. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  153.     = 0xA984;
  154. pascal DialogPtr NewCDialog(Ptr dStorage,const Rect *boundsRect,const Str255 title,
  155.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  156.     Handle items)
  157.     = 0xAA4B;
  158. DialogPtr newcdialog(Ptr dStorage,const Rect *boundsRect,char *title,Boolean visible,
  159.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle items); 
  160. pascal short GetAlrtStage(void)
  161.     = {0x3EB8,0x0A9A};
  162. pascal void ResetAlrtStage(void)
  163.     = {0x4278,0x0A9A};
  164. pascal void DlgCut(DialogPtr theDialog);
  165. pascal void DlgPaste(DialogPtr theDialog);
  166. pascal void DlgCopy(DialogPtr theDialog);
  167. pascal void DlgDelete(DialogPtr theDialog); 
  168. pascal void SetDAFont(short fontNum);
  169. void paramtext(char *param0,char *param1,char *param2,char *param3);
  170. void getitext(Handle item,char *text);
  171. void setitext(Handle item,char *text);
  172. short findditem(DialogPtr theDialog,Point *thePt);
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176.  
  177. #endif
  178.